In disk drives, defects on the media surface can cause the read channel to repeatedly detect incorrect data (hard errors). Very large defects may result in hard errors that are too long for the disk drive ECC algorithm to detect. Defect scans are used in the manufacturing process to flag those sectors with large defects so they are excluded from use during normal drive operation. The defect scan may comprise two main steps:                1. Write entire media surface with a high frequency repeating patterns;        2. Read back each sector and check for unusual changes in head signal amplitude.        
A high frequency pattern is written to maximize the probability of actually writing a transition on a small defect. If a transition is written on a defect, the resulting magnetic head amplitude increases or decreases based on the type of defect. A decrease in magnetic material on the media correspondingly decreases the amplitude of the read back signal (resulting in a localized read back signal drop-out) and an increase in magnetic material on the media correspondingly increases the amplitude of the read back signal (resulting in a localized read back signal drop-in).
Based upon the number of detected defects, it may be determined whether the disk drive is useable or not. The disk drive may fail the manufacturing process when too many defects are detected. Conventionally, if the disk drive is determined to be usable given the number and severity of the detected defects, a predetermined space around the detected defect is designated as a margin that becomes unavailable for user data. However, experience has shown that a detected defect may spread or “grow” from its original position during subsequent use of the disk drive. Such defects are commonly known as thermal asperities (TA) and often manifest themselves outside of the predetermined margins designated around the detected media defect. In some cases, the disk drive may ultimately fail in the hands of the end user, due to such grown defects. Conventionally, disk drives use a fixed number of sectors or tracks to margin TAs. As a result, the disk drive may either under margin or over margin the TA. If the disk drive under margins the TA by designating too few sectors and/or tracks around a TA as margin and thus unavailable for storage and retrieval of user data, the disk drive becomes prone to head and media collisions, which damage and degrade the performance of the head. If the drive over margins a TA by designating a greater number of sectors or tracks than necessary, the drive may not meet the target capacity.